<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>AirWeb数据平台</title>

    <!-- Bootstrap -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <nav class="navbar navbar-default" role="navigation">
        <div class="container">
          <div class="navbar-header">
              <a class="navbar-brand" href="#">数据平台</a>
          </div>
          <div>
            <ul class="nav navbar-nav">
                <li class="active"><a href="/">首页</a></li>
                <li><a href="/real">实时数据</a></li>
                <li><a href="/his?type=1">分钟数据</a></li>
                <li><a href="/his?type=2">小时数据</a></li>
                <li><a href="/his?type=3">日数据</a></li>
            </ul>
          </div>
        </div>
    </nav>
    <form class="form-horizontal" role="form" id="searchform">
      <div class="form-group">
        <label for="mn" class="col-sm-2 control-label">设备编号</label>
        <div class="col-sm-4">
          <input type="text" class="form-control" id="mn" name="mn">
        </div>
      </div>
      <div class="form-group">
        <label for="code" class="col-sm-2 control-label">数据编码</label>
        <div class="col-sm-4">
          <input type="text" class="form-control" id="code" name="code">
        </div>
      </div>
      <div class="form-group">
        <label for="datatype" class="col-sm-2 control-label">数据类型</label>
        <div class="col-sm-4">
          <select class="form-control" id="datatype" name="datatype">
            <option>实时数据</option>
            <option>分钟数据</option>
            <option>小时数据</option>
            <option>日数据</option>
          </select>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-2">
          <button type="submit" class="btn btn-default" id="search">开始查询</button>
        </div>
      </div>
      <div><input type="hidden" id="type" name="type"></div>
    </form>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
     
    <script type="text/javascript">
    $(document).ready(forminit);

    function forminit()
    {
      $("#search").click(function() {
        $("#type").get(0).value = $("#datatype").get(0).selectedIndex;
        if ($("#type").get(0).value == 0)
          $("#searchform").get(0).action = "/real";
        else
          $("#searchform").get(0).action = "/his";
      });
    }
    </script>
  </body>
</html>